Follow-up to r37968: forgot to commit the change setRobotpolicy -> setRobotPolicy...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 23 Jul 2008 19:25:48 +0000 (19:25 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 23 Jul 2008 19:25:48 +0000 (19:25 +0000)
includes/MagicWord.php
includes/parser/Parser.php
includes/parser/ParserOutput.php
languages/messages/MessagesEn.php

index 5284e62..ca2a113 100644 (file)
@@ -105,6 +105,8 @@ class MagicWord {
                'numberofadmins',
                'defaultsort',
                'pagesincategory',
+               'index',
+               'noindex',
        );
 
        /* Array of caching hints for ParserCache */
@@ -153,6 +155,8 @@ class MagicWord {
                'noeditsection',
                'newsectionlink',
                'hiddencat',
+               'index',
+               'noindex',
        );
 
 
index b9e0cee..404f94a 100644 (file)
@@ -3380,6 +3380,15 @@ class Parser
                                wfDebug( __METHOD__.": [[MediaWiki:hidden-category-category]] is not a valid title!\n" );
                        }
                }
+               # (bug 8068) Allow control over whether robots index a page.  FIXME:
+               # __INDEX__ always overrides __NOINDEX__ here!  This is not desirable,
+               # the last one on the page should win.
+               if( isset( $this->mDoubleUnderscores['noindex'] ) ) {
+                       $this->mOutput->setIndexPolicy( 'noindex' );
+               } elseif( isset( $this->mDoubleUnderscores['index'] ) ) {
+                       $this->mOutput->setIndexPolicy( 'index' );
+               }
+
                return $text;
        }
 
index f98d564..5f69af7 100644 (file)
@@ -23,7 +23,8 @@ class ParserOutput
                $mOutputHooks,      # Hook tags as per $wgParserOutputHooks
                $mWarnings,         # Warning text to be returned to the user. Wikitext formatted, in the key only
                $mSections,         # Table of contents
-               $mProperties;       # Name/value pairs to be cached in the DB
+               $mProperties,       # Name/value pairs to be cached in the DB
+               $mIndexPolicy;          # 'index' or 'noindex'?  Default is null
 
        /**
         * Overridden title for display
@@ -52,6 +53,7 @@ class ParserOutput
                $this->mOutputHooks = array();
                $this->mWarnings = array();
                $this->mProperties = array();
+               $this->mIndexPolicy = null;
        }
 
        function getText()                   { return $this->mText; }
index 2361b84..1ec6886 100644 (file)
@@ -340,6 +340,8 @@ $magicWords = array(
        'hiddencat'              => array( 1,    '__HIDDENCAT__'          ),
        'pagesincategory'        => array( 1,    'PAGESINCATEGORY', 'PAGESINCAT' ),
        'pagesize'               => array( 1,    'PAGESIZE'               ),
+       'index'                  => array( 1,    '__INDEX__'              ),
+       'noindex'                => array( 1,    '__NOINDEX__'            ),
 );
 
 /**